package com.cyou.nad.utils;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * 
 * @author wl
 *
 */
public class LocalMachineInfoUtils {
	/**
	 * 获取当前机器IP
	 * @return
	 */
	public static String getLocalMachineIp() {
		String info = null;
		try {
			info = InetAddress.getLocalHost().getHostAddress();
		} catch (UnknownHostException e) {
			e.printStackTrace();
		}

		return info;		
	}
	/**
	 * 获取当前机器名
	 * @return
	 */
	public static String getLocalMachineName() {
		String info = null;
		try {
			info = InetAddress.getLocalHost().getHostName();
		} catch (UnknownHostException e) {
			e.printStackTrace();
		}

		return info;		
	}

}
